# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=hasher
pkgver=48.40173c5
pkgrel=6
groups=('blackarch' 'blackarch-cracker' 'blackarch-crypto')
pkgdesc='A tool that allows you to quickly hash plaintext strings, or compare hashed values with a plaintext locally.'
arch=('any')
url='https://github.com/ChrisTruncer/Hasher'
depends=('python2' 'python2-passlib' 'python2-bcrypt')
makedepends=('git' 'python2-setuptools')
license=('GPL3')
source=("$pkgname::git+https://github.com/ChrisTruncer/Hasher.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|py-bcrypt>=0.4|bcrypt|' setup.py
}

build() {
  cd $pkgname

  python2 setup.py build
}

package() {
  cd $pkgname

  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

